#! /usr/bin/python3
# -*- coding: utf-8 -*-
import cv2

image = cv2.imread("D:/opencv class/lena.jpg", cv2.IMREAD_COLOR)
image = cv2.resize(image, (int(image.shape[0] / 2), int(image.shape[1] / 2)), interpolation=cv2.INTER_CUBIC)
cv2.imshow("lena", image)
cv2.imshow("COLOR B", image[:, :, 0])
cv2.imshow("COLOR G", image[:, :, 1])
cv2.imshow("COLOR R", image[:, :, 2])

#转换色彩空间
image_hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
cv2.imshow("Hue", image_hsv[:, :, 0])
cv2.imshow("Saturation", image_hsv[:, :, 1])
cv2.imshow("Value", image_hsv[:, :, 2])
cv2.waitKey()